@extends('layout.layout')
@section('title')
	{{ $title }}
@endsection

@section('css')
	#error{
		width:500px;
		height:50px;
		background:yellowgreen;
		cursor:pointer;
		color:#666;
		font-size:20px;
		line-height:50px;
	}
@endsection

@section('js')
	<script src="/js/jquery-1.8.3.min.js"></script>
	<script>
		$(function(){
			$('#error').click(function(){
				$(this).slideUp('slow')
			})
		})
	</script>
@endsection
@section('content')
		<form action="/user/update/{{ $data['id'] }}" method="post">
			<table width="500" border="1">
				@if(session('error'))
				<div id="error">
				{{ session('error') }}
				</div>
				@endif
				<caption><h3>{{$title}}</h3></caption>
				{{ csrf_field() }}
				<tr>
					<th>用户名</th>
					<td><input type="text" name="username" value="{{$data['username']}}"></td>
				</tr>
				<tr>
					<th>性别</th>
					<td><input type="text" name="sex" value="{{$data['sex']}}"></td>
				</tr>
				
				<tr>
					<th>年龄</th>
					<td><input type="text" name="age" value="{{$data['age']}}"></td>
				</tr>
				<tr>
					<th colspan="2">
						<input type="submit" value="修改">
					</th>
				</tr>
			</table>
		</form>
@endsection